package com.csnj.common.entity;

import com.csnj.common.exception.IRCException;
import lombok.Data;

/**
 * Created by xiabin on 2017/8/14.
 */
@Data
public class APIResult {

    private int resultCode;

    private String resultMsg;

    private Object data;

    private Long ts = System.currentTimeMillis();

    public Long getTs() {
        return ts;
    }

    public void setTs(Long ts) {
        this.ts = ts;
    }

    public APIResult(Object resData) {
        resultCode = 0;
        resultMsg = "OK";
        data = resData;
    }

    public APIResult(IRCException e) {
        resultCode = e.getCode();
        resultMsg = e.getMsg();
    }
}